package com.zb.sannuo.maintenance.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zb.sannuo.common.domain.Role;
import com.zb.sannuo.common.domain.vo.RolePermissionVo;
import com.zb.sannuo.maintenance.dao.RolePermissionMapper;
import com.zb.sannuo.maintenance.service.RolePermissionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class RolePermissionServiceImpl extends ServiceImpl<RolePermissionMapper, RolePermissionVo> implements RolePermissionService {

    @Resource
    private RolePermissionMapper rolePermissionMapper;

    @Override
    public Page selectListRolePermission(int current, int number) {
        Page page = new Page(current,number);
        return page.setRecords(rolePermissionMapper.queryRolePermission(page));
    }

    @Override
    public int addPermission(Role role) {
        return rolePermissionMapper.addPermission(role);
    }

    @Override
    public int updatePermission(Role role) {
        return rolePermissionMapper.updatePermission(role);
    }
}
